#!/usr/bin/python
# -*- coding: utf-8 -*-

import Ice, sys
import BlackboardI
from BlackboardI import *

class BlackboardServer (Ice.Application):

    def run (self, argv):
        
        self.shutdownOnInterrupt()

        properties = self.communicator().getProperties()
        camera = properties.getProperty('camera');
	index = properties.getProperty('index');

        print 'BlackboardAdapter.' + str(camera) + '.' + str(index)
        adapter = self.communicator().createObjectAdapter('BlackboardAdapter.' + str(camera) + '.' + str(index))
        adapter.add(BlackboardI(index, self.communicator()),
                    self.communicator().stringToIdentity("blackboard"))
        adapter.activate()

        self.communicator().waitForShutdown()

        return 0

BlackboardServer().main(sys.argv)
sys.exit(app.main(sys.argv))
